<?php 

$p = $_POST['p'];

$db = include './db.php';

$db = array_slice($db,($p-1)*3,3,true);


$str = "";

foreach ($db as $k => $v) {
	$str .='<div class="list-group-item">
    <h4 class="list-group-item-heading">'.$v[ 'username'].'('.date( 'Y-m-d H:i:s',$v[ 'create_time']).')</h4>
    <p class="list-group-item-text">'.$v[ 'content'].'</p>
    <p class="list-group-item-text">
        <a href="./del.php?id='.$k.'" class="btn btn-danger" onclick="if(confirm(\'确定删除吗\')==false){return false;}">删除 </a><a href="./edit.php?id='.$k.'" class="btn btn-primary">修改</a>
    </p>
</div>';
}

echo $str;

 ?>